Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace floating point sizing formula in stack with integer operations. #1321

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

duvenaud
Copy link
Contributor

@duvenaud duvenaud commented Jul 2, 2023

The required code was already in the FFT demo.

@duvenaud
Copy link
Contributor Author

duvenaud commented Jul 5, 2023

Not sure if this could be a test, but to put your mind at ease, here are the old and new functions:

for req_size:(Fin 17). f_to_n $ 2.0 `pow` (ceil $ log2 $ n_to_f (ordinal req_size))
[0, 1, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16]

for req_size:(Fin 17). intpow2 $ nextpow2 (ordinal req_size)
[1, 1, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16]

@axch axch merged commit 2580bc9 into google-research:main Jul 5, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants